#include "../abc_archive.h"
#include <regex>

namespace abc_query
{
    inline bool pathMatchesModule(const abc::Path &path, const std::string &module)
    {
        return path.module == module;
    }

    inline bool pathMatchesPackage(const abc::Path &path, const std::string &pkg)
    {
        return path.package == pkg;
    }

    inline bool nameMatchesPattern(const std::string &name, const std::string &pattern)
    {
        try
        {
            std::regex re(pattern);
            return name == pattern;
            // return std::regex_search(name, re);
        }
        catch (...)
        {
            return false;
        }
    }

}